home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 2
/
Atari Mega Archive CD - Volume 2.iso
/
minix
/
up1510b.tgz
/
up1510b
/
src
/
fs
/
write.c.D
< prev
Wrap
Text File
|
1990-07-25
|
5KB
|
162 lines
*** /tmp/,RCSt1022271 Wed Jul 25 13:49:13 1990
--- write.c Mon Jul 23 11:34:29 1990
***************
*** 9,24 ****
*/
! #include "../h/const.h"
! #include "../h/type.h"
! #include "../h/error.h"
! #include "const.h"
! #include "type.h"
#include "buf.h"
#include "file.h"
#include "fproc.h"
- #include "glo.h"
#include "inode.h"
#include "super.h"
/*===========================================================================*
* do_write *
--- 9,21 ----
*/
! #include "fs.h"
#include "buf.h"
#include "file.h"
#include "fproc.h"
#include "inode.h"
#include "super.h"
+ FORWARD int write_map();
+
/*===========================================================================*
* do_write *
***************
*** 36,40 ****
PRIVATE int write_map(rip, position, new_zone)
register struct inode *rip; /* pointer to inode to be changed */
! file_pos position; /* file address to be mapped */
zone_nr new_zone; /* zone # to be inserted */
{
--- 33,37 ----
PRIVATE int write_map(rip, position, new_zone)
register struct inode *rip; /* pointer to inode to be changed */
! off_t position; /* file address to be mapped */
zone_nr new_zone; /* zone # to be inserted */
{
***************
*** 48,55 ****
int new_ind, new_dbl;
- extern zone_nr alloc_zone();
- extern struct buf *get_block();
- extern real_time clock_time();
-
rip->i_dirt = DIRTY; /* inode will be changed */
bp = NIL_BUF;
--- 45,48 ----
***************
*** 59,64 ****
/* Is 'position' to be found in the inode itself? */
if (zone < NR_DZONE_NUM) {
! rip->i_zone[zone] = new_zone;
! rip->i_modtime = clock_time();
return(OK);
}
--- 52,57 ----
/* Is 'position' to be found in the inode itself? */
if (zone < NR_DZONE_NUM) {
! rip->i_zone[(int) zone] = new_zone;
! rip->i_update = MTIME; /* mark mtime for update later */
return(OK);
}
***************
*** 110,115 ****
bp = get_block(rip->i_dev, b, (new_ind ? NO_READ : NORMAL) );
if (new_ind) zero_block(bp);
! bp->b_ind[excess] = new_zone;
! rip->i_modtime = clock_time();
bp->b_dirt = DIRTY;
put_block(bp, INDIRECT_BLOCK);
--- 103,108 ----
bp = get_block(rip->i_dev, b, (new_ind ? NO_READ : NORMAL) );
if (new_ind) zero_block(bp);
! bp->b_ind[(int) excess] = new_zone;
! rip->i_update = MTIME; /* mark mtime for update later */
bp->b_dirt = DIRTY;
put_block(bp, INDIRECT_BLOCK);
***************
*** 121,127 ****
* clear_zone *
*===========================================================================*/
! PUBLIC clear_zone(rip, pos, flag)
register struct inode *rip; /* inode to clear */
! file_pos pos; /* points to block to clear */
int flag; /* 0 if called by read_write, 1 by new_block */
{
--- 114,120 ----
* clear_zone *
*===========================================================================*/
! PUBLIC void clear_zone(rip, pos, flag)
register struct inode *rip; /* inode to clear */
! off_t pos; /* points to block to clear */
int flag; /* 0 if called by read_write, 1 by new_block */
{
***************
*** 133,141 ****
register struct buf *bp;
register block_nr b, blo, bhi;
! register file_pos next;
register int scale;
register zone_type zone_size;
- extern struct buf *get_block();
- extern block_nr read_map();
/* If the block size and zone size are the same, clear_zone() not needed. */
--- 126,132 ----
register struct buf *bp;
register block_nr b, blo, bhi;
! register off_t next;
register int scale;
register zone_type zone_size;
/* If the block size and zone size are the same, clear_zone() not needed. */
***************
*** 166,170 ****
PUBLIC struct buf *new_block(rip, position)
register struct inode *rip; /* pointer to inode */
! file_pos position; /* file pointer */
{
/* Acquire a new block and return a pointer to it. Doing so may require
--- 157,161 ----
PUBLIC struct buf *new_block(rip, position)
register struct inode *rip; /* pointer to inode */
! off_t position; /* file pointer */
{
/* Acquire a new block and return a pointer to it. Doing so may require
***************
*** 179,186 ****
int scale, r;
struct super_block *sp;
- extern struct buf *get_block();
- extern struct super_block *get_super();
- extern block_nr read_map();
- extern zone_nr alloc_zone();
/* Is another block available in the current zone? */
--- 170,173 ----
***************
*** 217,221 ****
* zero_block *
*===========================================================================*/
! PUBLIC zero_block(bp)
register struct buf *bp; /* pointer to buffer to zero */
{
--- 204,208 ----
* zero_block *
*===========================================================================*/
! PUBLIC void zero_block(bp)
register struct buf *bp; /* pointer to buffer to zero */
{